﻿#region Usings

using System;
using System.ComponentModel.DataAnnotations;

#endregion

namespace RailNet.Dao.Entity
{
    [DisplayColumn("Id")]
    [Serializable]
    public class RelationDescription : IEquatable<RelationDescription>, IEntity
    {
        #region Primitive Properties

        [Key]
        public long Id { get; set; }

        [Required]
        public DateTime ValidFrom { get; set; }

        [Required]
        public DateTime ValidTo { get; set; }

        [Required]
        public short StationType { get; set; }

        [Required]
        public bool Included { get; set; }

        #endregion

        #region Navigation Properties

        [Required]
        public virtual Relation Relation { get; set; }

        [Required]
        public virtual Station Station { get; set; }

        #endregion

        #region IEquatable members

        public bool Equals(RelationDescription other)
        {
            return Id == other.Id;
        }

        #endregion
    }
}